﻿<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link href="~/Content/css/framework-font.css" rel="stylesheet" />
    <link href="~/Content/css/framework-ui.css" rel="stylesheet" />
    <script src="~/Content/js/jquery/jquery-2.1.1.min.js"></script>
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <link href="~/Content/js/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <script src="~/Content/js/charts/Chart.js"></script>
    <script src="~/Content/js/jqgrid/jqgrid.min.js"></script>
    <link href="~/Content/js/jqgrid/jqgrid.css" rel="stylesheet" />
    <script src="~/Content/js/jqgrid/grid.locale-cn.js"></script>
    <script src="~/Content/js/framework-ui.js"></script>
    <script src="~/Content/js/bootstrap/bootstrap.js"></script>
    <script type="text/javascript">
    $(function () {
        gridList();
    })
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/BusinessManage/D_NewsList/GetGridJson",
            height: $(window).height() - 96,
            colModel: [
                { label: "主键", name: "F_Id", hidden: true, key: true },
                { label: '标题', name: 'F_Title', width: 200, align: 'center' },
                { label: '简述', name: 'F_Sketch', width: 400, align: 'center' },
                {
                    label: '创建时间', name: 'F_CreatorTime', width: 200, align: 'center',
                    formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
                },
                { label: '查看',name: 'View', index: 'View', sortable: false, align: "center", width: "100px" },
            ],
            pager: "#gridPager",
            sortname: 'F_CreatorTime desc',
            viewrecords: true,
            gridComplete : function() {
            var ids = $gridList.jqGrid('getDataIDs');
            for (var i = 0; i < ids.length; i++)
            {
                var id = ids[i];
                var viewBtn = "<a href='javascript:void();' style='color:#f60' onclick='btn_edit(\""+id+"\");' >查看</a>";
                $gridList.jqGrid('setRowData', ids[i], { View: viewBtn });
            }
            }
        });
    }
    function btn_edit(keyValue) {
        //var keyValue = $("#gridList").jqGridRowValue().F_Id;
        $.modalOpen({
            id: "Content",
            title: "通知信息",
            url: "/BusinessManage/D_NewsList/Content?keyValue=" + keyValue,
            width: "650px",
            height: "600px",
            callBack: function (iframeId) {
                top.frames[iframeId].submitForm();
            }
        });
    }
    </script>
</head>
<body>
    <div id="areascontent">
        <div class="rows" style="margin-bottom: 1%; border: 1px solid #e6e6e6; overflow: hidden; padding-left: 1px;">
            <div class="panel-body" style="height:100%;">
                <div class="gridPanel">
                    <table id="gridList"></table>
                </div>
            </div>
        </div>
    </div>    
</body>
</html>
